<template>
    <div>
        <el-row :gutter="15">
			<el-form ref="elForm" :model="dataForm" :rules="rules" size="medium" label-width="130px" label-position="right" :disabled="setting.readonly">
				<el-col :span="12" v-if="JudgeShow('zyzmc')">
					<el-form-item label="作业证名称" prop="zyzmc" >
						<el-input v-model="dataForm.zyzmc"  :disabled ="JudgeWrite('zyzmc')"  placeholder="请输入" clearable :style='{"width":"100%"}' >
							<template slot="prepend"></template>
							<template slot="append"></template>
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zyzbh')">
					<el-form-item label="作业证编号" prop="zyzbh" >
						<el-input v-model="dataForm.zyzbh"  :disabled ="JudgeWrite('zyzbh')"  placeholder="系统自动生成" readonly >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqdw')">
					<el-form-item label="申请单位" prop="sqdw" >
						<el-select v-model="dataForm.sqdw"  :disabled ="JudgeWrite('sqdw')"  placeholder="请选择" filterable @change="person" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sqdwOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqrq')">
					<el-form-item label="申请日期" prop="sqrq" >
						<el-date-picker v-model="dataForm.sqrq"  :disabled ="JudgeWrite('sqrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqr')">
					<!-- <el-form-item label="申请人" prop="sqr" >
						<el-select v-model="dataForm.sqr"  :disabled ="JudgeWrite('sqr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sqrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item> -->
					<el-form-item label="申请人" prop="sqr" >
						<el-select  :disabled="JudgeWrite('sqr')" v-model="dataForm.sqr" placeholder="请选择" clearable :style='{"width":"100%"}' filterable>
							<el-option v-for="(item, index) in personAll" :key="index" :label="item.realName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zydw')">
					<el-form-item label="作业单位" prop="zydw" >
						<el-select v-model="dataForm.zydw"  :disabled ="JudgeWrite('zydw')"  placeholder="请选择" @change="personSomePerson" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in zydwOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zydwfzr')">
					<!-- <el-form-item label="作业单位负责人" prop="zydwfzr" >
						<el-select v-model="dataForm.zydwfzr"  :disabled ="JudgeWrite('zydwfzr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in zydwfzrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item> -->
					<el-form-item label="作业单位负责人" prop="zydwfzr" >
						<el-select  :disabled="JudgeWrite('zydwfzr')" v-model="dataForm.zydwfzr" placeholder="请选择" clearable :style='{"width":"100%"}' filterable>
							<el-option v-for="(item, index) in personSome" :key="index" :label="item.realName" :value="item.id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('xgdw')">
					<el-form-item label="涉及相关单位" prop="xgdw" >
						<el-select v-model="dataForm.xgdw"  :disabled ="JudgeWrite('xgdw')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in xgdwOptions" :key="index" :label="item.F_FullName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('dlyy')">
					<el-form-item label="断路原因" prop="dlyy" >
						<el-input v-model="dataForm.dlyy"  :disabled ="JudgeWrite('dlyy')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('dlkssj')">
					<el-form-item label="断路开始时间" prop="dlkssj" >
						<el-date-picker v-model="dataForm.dlkssj"  :disabled ="JudgeWrite('dlkssj')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('dljssj')">
					<el-form-item label="断路结束时间" prop="dljssj" >
						<el-date-picker v-model="dataForm.dljssj"  :disabled ="JudgeWrite('dljssj')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('xgsm')">
					<el-form-item label="相关说明" prop="xgsm" >
						<el-input v-model="dataForm.xgsm"  :disabled ="JudgeWrite('xgsm')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('xgsmqz')">
					<el-form-item label="相关说明签字" prop="xgsmqz" >
						<el-select v-model="dataForm.xgsmqz"  :disabled ="JudgeWrite('xgsmqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in xgsmqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('xgsmrq')">
					<el-form-item label="相关说明签字日期" prop="xgsmrq" >
						<el-date-picker v-model="dataForm.xgsmrq"  :disabled ="JudgeWrite('xgsmrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('whbs')">
					<el-form-item label="危害辨识" prop="whbs" >
						<el-input v-model="dataForm.whbs"  :disabled ="JudgeWrite('whbs')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('aqcs')">
					<el-form-item label="安全措施确认人" prop="aqcs" >
						<el-select v-model="dataForm.aqcs"  :disabled ="JudgeWrite('aqcs')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in aqcsOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('qtaqcs')">
					<el-form-item label="其他安全措施" prop="qtaqcs" >
						<el-input v-model="dataForm.qtaqcs"  :disabled ="JudgeWrite('qtaqcs')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('qtaqcsbzr')">
					<el-form-item label="编制人" prop="qtaqcsbzr" >
						<el-select v-model="dataForm.qtaqcsbzr"  :disabled ="JudgeWrite('qtaqcsbzr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in qtaqcsbzrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('qtaqcsqrr')">
					<el-form-item label="确认人" prop="qtaqcsqrr" >
						<el-select v-model="dataForm.qtaqcsqrr"  :disabled ="JudgeWrite('qtaqcsqrr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in qtaqcsqrrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('ssaqjyr')">
					<el-form-item label="实施安全教育人" prop="ssaqjyr" >
						<el-select v-model="dataForm.ssaqjyr"  :disabled ="JudgeWrite('ssaqjyr')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in ssaqjyrOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('sqdwyj')">
					<el-form-item label="申请单位意见" prop="sqdwyj" >
						<el-input v-model="dataForm.sqdwyj"  :disabled ="JudgeWrite('sqdwyj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqdwqz')">
					<el-form-item label="申请单位签字" prop="sqdwqz" >
						<el-select v-model="dataForm.sqdwqz"  :disabled ="JudgeWrite('sqdwqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in sqdwqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('sqdwyjrq')">
					<el-form-item label="申请单位签字日期" prop="sqdwyjrq" >
						<el-date-picker v-model="dataForm.sqdwyjrq"  :disabled ="JudgeWrite('sqdwyjrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('zydwyj')">
					<el-form-item label="作业单位意见" prop="zydwyj" >
						<el-input v-model="dataForm.zydwyj"  :disabled ="JudgeWrite('zydwyj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zydwqz')">
					<el-form-item label="作业单位签字" prop="zydwqz" >
						<el-select v-model="dataForm.zydwqz"  :disabled ="JudgeWrite('zydwqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in zydwqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('zydwrq')">
					<el-form-item label="作业单位签字日期" prop="zydwrq" >
						<el-date-picker v-model="dataForm.zydwrq"  :disabled ="JudgeWrite('zydwrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('spbmyj')">
					<el-form-item label="审批部门意见" prop="spbmyj" >
						<el-input v-model="dataForm.spbmyj"  :disabled ="JudgeWrite('spbmyj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('spbmqz')">
					<el-form-item label="审批部门签字" prop="spbmqz" >
						<el-select v-model="dataForm.spbmqz"  :disabled ="JudgeWrite('spbmqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in spbmqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('spbmrq')">
					<el-form-item label="审批部门签字日期" prop="spbmrq" >
						<el-date-picker v-model="dataForm.spbmrq"  :disabled ="JudgeWrite('spbmrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="24" v-if="JudgeShow('wgysyj')">
					<el-form-item label="完工验收" prop="wgysyj" >
						<el-input v-model="dataForm.wgysyj"  :disabled ="JudgeWrite('wgysyj')"  placeholder="请输入" show-word-limit :style='{"width":"100%"}' type="textarea" :autosize='{"minRows":4,"maxRows":100}' >
						</el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('wgysqz')">
					<el-form-item label="完工验收签字" prop="wgysqz" >
						<el-select v-model="dataForm.wgysqz"  :disabled ="JudgeWrite('wgysqz')"  placeholder="请选择" clearable :style='{"width":"100%"}' >
							<el-option v-for="(item, index) in wgysqzOptions" :key="index" :label="item.F_RealName" :value="item.F_Id" ></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12" v-if="JudgeShow('wgysrq')">
					<el-form-item label="完工验收日期" prop="wgysrq" >
						<el-date-picker v-model="dataForm.wgysrq"  :disabled ="JudgeWrite('wgysrq')"  placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
						</el-date-picker>
					</el-form-item>
				</el-col>
			</el-form>

        </el-row>
        <UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
    </div>
</template>
<script>
    import request from '@/utils/request'
    import { previewDataInterface } from '@/api/systemData/dataInterface'
    import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
    import {departmentPerson}from '@/api/systemIntegration/recard'

    export default {
        components: {},
        props: [],
        data() {
            return {
							personAll:[], // 申请人
							personSome:[], // 作业单位负责人
							visible: false,
					setting: {},
					eventType: '',
					userBoxVisible: false,
					dataForm: {
					id:'',                    
					flowId: '',
					actionType:1,
					freeApproverUserId: '',
					zyzmc:undefined,
					zyzbh:undefined,
					sqdw:"",
					sqrq:undefined,
					sqr:undefined,
					zydw:undefined,
					zydwfzr:undefined,
					xgdw:undefined,
					dlyy:undefined,
					dlkssj:undefined,
					dljssj:undefined,
					xgsm:undefined,
					xgsmqz:undefined,
					xgsmrq:undefined,
					whbs:undefined,
					aqcs:undefined,
					qtaqcs:undefined,
					qtaqcsbzr:undefined,
					qtaqcsqrr:undefined,
					ssaqjyr:undefined,
					sqdwyj:undefined,
					sqdwqz:undefined,
					sqdwyjrq:undefined,
					zydwyj:undefined,
					zydwqz:undefined,
					zydwrq:undefined,
					spbmyj:undefined,
					spbmqz:undefined,
					spbmrq:undefined,
					wgysyj:undefined,
					wgysqz:undefined,
					wgysrq:undefined,

                },
                rules: {

                },
				sqdwOptions:[],
				sqrOptions:[],
				zydwOptions:[],
				zydwfzrOptions:[],
				xgdwOptions:[],
				xgsmqzOptions:[],
				aqcsOptions:[],
				qtaqcsbzrOptions:[],
				qtaqcsqrrOptions:[],
				ssaqjyrOptions:[],
				sqdwqzOptions:[],
				zydwqzOptions:[],
				spbmqzOptions:[],
				wgysqzOptions:[],


            }
        },
        computed: {},
        watch: {},
        created() {
		this.getsqdwOptions();
		this.getsqrOptions();
		this.getzydwOptions();
		this.getzydwfzrOptions();
		this.getxgdwOptions();
		this.getxgsmqzOptions();
		this.getaqcsOptions();
		this.getqtaqcsbzrOptions();
		this.getqtaqcsqrrOptions();
		this.getssaqjyrOptions();
		this.getsqdwqzOptions();
		this.getzydwqzOptions();
		this.getspbmqzOptions();
		this.getwgysqzOptions();

        },
				mounted(){
					this.dlaqzyz()
				},
        methods: {
		getsqdwOptions()
		{
			previewDataInterface('772d2cbcadd24df79243e3d92ef5f690').then(res => {
				this.sqdwOptions = res.data
			})
		},
		getsqrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.sqrOptions = res.data
			})
		},
		getzydwOptions()
		{
			previewDataInterface('772d2cbcadd24df79243e3d92ef5f690').then(res => {
				this.zydwOptions = res.data
			})
		},
		getzydwfzrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.zydwfzrOptions = res.data
			})
		},
		getxgdwOptions()
		{
			previewDataInterface('772d2cbcadd24df79243e3d92ef5f690').then(res => {
				this.xgdwOptions = res.data
			})
		},
		getxgsmqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.xgsmqzOptions = res.data
			})
		},
		getaqcsOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.aqcsOptions = res.data
			})
		},
		getqtaqcsbzrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.qtaqcsbzrOptions = res.data
			})
		},
		getqtaqcsqrrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.qtaqcsqrrOptions = res.data
			})
		},
		getssaqjyrOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.ssaqjyrOptions = res.data
			})
		},
		getsqdwqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.sqdwqzOptions = res.data
			})
		},
		getzydwqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.zydwqzOptions = res.data
			})
		},
		getspbmqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.spbmqzOptions = res.data
			})
		},
		getwgysqzOptions()
		{
			previewDataInterface('8bca424f16d6448ab09e57a028853aa9').then(res => {
				this.wgysqzOptions = res.data
			})
		},

            goBack() {
                this.$emit('refresh')
            },
						// 申请人
						async person(id) {
							this.dataForm.sqr = ''
							const {data} = await departmentPerson({organizeId:id})
							this.personAll = data.list
						},
						// 作业单位负责人
						async personSomePerson(id) {
							this.dataForm.zydwfzr = ''
							const {data} = await departmentPerson({organizeId:id})
							this.personSome = data.list
						},
						fullName(val,id) {
							this.person(id)
							this.val = val
							this.dataForm.sqdw = val
						},
						// 数据回填 调人员接口
						dlaqzyz() {
							let fullName = this.$store.getters.itemData.fullName
              switch (fullName) {   
                case '禄口油库断路安全作业证':
                  return this.fullName('禄口油库','0e7420aab60f4d1d9297be06258760e9')
								break;
								case '航空加油站断路安全作业证':
									return this.fullName('航空加油站','aa579f18def44c298497c7a9727fcf76')
								break;
								case '管道中心断路安全作业证':
									return this.fullName('管道中心','0f3b5731aa2f4542a0b143e858c59b66')
								break;
								case '机坪车辆加油站断路安全作业证':
									return this.fullName('机坪车辆加油站','3094a0f6f74d470e9b95dcc406bfcb0f')
								break;
							}
						},
            init(data) {
                this.loading = true
                this.dataForm.id = data.id || ''
                this.setting = data
                this.visible = true;
                this.$nextTick(() => {
                    this.$refs['elForm'].resetFields();
                    if (this.dataForm.id) {
                        request({
                            url: '/api/WorkFlowForm/qyscDlaqzyz/' + this.dataForm.id,
                            method: 'get'
                        }).then(res => {
                            this.dataForm = res.data
														this.dataForm.sqdw = this.val

                        })
                    } else {
                        this.dataForm.flowId = data.flowId
												this.dataForm.sqdw = this.val
                    }
                    this.loading = false
                })
            },
            // 表单提交
            dataFormSubmit(eventType) {            

                this.$refs['elForm'].validate((valid) => {
                    if (valid) {
                        if (eventType === 'audit' || eventType === 'reject') {
                            this.$emit('approval', this.dataForm, eventType)
                            return 
                         }
                        this.dataForm.actionType = eventType === 'submit' ? 0 : 1
                        this.eventType = eventType
                        if (this.eventType === 'submit') {
                            if (this.setting.freeApprover == 0) {
                                this.$confirm('您确定要提交当前流程吗, 是否继续?', '提示', {
                                    type: 'warning'
                                }).then(() => {
                                    this.submit()
                                }).catch(() => { });
                            } else {
                                this.userBoxVisible = true
                                this.$nextTick(() => {
                                    this.$refs.userBox.init()
                                })
                            }
                        } else {
                            this.request()
                        }
                    }
                })
            },
            submit(freeApproverUserId) {
                if (freeApproverUserId) this.dataForm.freeApproverUserId = freeApproverUserId
                this.request()
            },
            request() {
                if (!this.dataForm.id) {
                    delete (this.dataForm.id)
                    request({
                        url: '/api/WorkFlowForm/qyscDlaqzyz',
                        method: 'post',
                        data: this.dataForm
                    }).then((res) => {
                        this.$message({
                            message: res.msg,
                            type: 'success',
                            duration: 1000,
                            onClose: () => {
                                this.visible = false
                                this.$emit('close', true)
                            }
                        })
                    })
                } else {
                    request({
                        url: '/api/WorkFlowForm/qyscDlaqzyz/' + this.dataForm.id,
                        method: 'PUT',
                        data: this.dataForm
                    }).then((res) => {
                        this.$message({
                            message: res.msg,
                            type: 'success',
                            duration: 1000,
                            onClose: () => {
                                this.visible = false
                                this.$emit('close', true)
                            }
                        })
                    })
                }
            },
            JudgeShow(id) {
                if (!this.setting.formOperates || !this.setting.formOperates.length) return true
                let arr = this.setting.formOperates.filter(o => o.id === id) || []
                if (!arr.length) return true
                let item = arr[0]
                return item.read
            },
            JudgeWrite(id) {
                if (!this.setting.formOperates || !this.setting.formOperates.length) return false
                let arr = this.setting.formOperates.filter(o => o.id === id) || []
                if (!arr.length) return true
                let item = arr[0]
                return !item.write
            },

        },
    }

</script>
